
const dom1 = document.getElementById('div1')
// console.log(dom1)
const dom2 = document.getElementsByTagName('div')
// console.log(dom2[0])
const dom3 = document.getElementsByClassName('container')
// console.log(dom3)
const dom4 = document.querySelectorAll('p')
console.log(dom4)
const p1 = dom4[0]
// property
p1.style.color = 'green'
p1.style.width = '200px'
// p1.className = 'red'
console.log(p1.nodeName)
console.log(p1.nodeType) 
// attribute 
p1.setAttribute('data-name', 'imooc')
console.log(p1.getAttribute('data-name'))
p1.setAttribute('style', 'font-size: 20px;')